﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                    xmlns:Binding="clr-namespace:WPF.RealTime.Data.Binding;assembly=WPF.RealTime.Data">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="Royale.NormalColor.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <!-- Select properties of SelectableDataItem for different ItemsControls -->
    <Style x:Key="MultipleSelection">
        <Setter Property="Selector.IsSelected" Value="{Binding Path=IsSelected}"/>
    </Style>
    <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource MultipleSelection}" />
    <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource MultipleSelection}" />
    <Style TargetType="{x:Type ListBoxItem}" BasedOn="{StaticResource MultipleSelection}" />

    <Style TargetType="{x:Type DataGrid}">
        <Setter Property="VirtualizingStackPanel.IsVirtualizing" Value="True"/>
        <Setter Property="VirtualizingStackPanel.VirtualizationMode" Value="Recycling"/>
        <Setter Property="ScrollViewer.IsDeferredScrollingEnabled" Value="False"/>
    </Style>
    <!-- Displayable properties of SelectableDataItem -->
    <DataTemplate DataType="{x:Type Binding:DataItem}">
        <TextBlock Text="{Binding Path=Value}"></TextBlock>
    </DataTemplate>
     
    <!--RadioButton List Style-->
    <DataTemplate x:Key="RadioButtonListStyle">
        <StackPanel Orientation="Horizontal">
            <RadioButton IsChecked="{Binding Path=IsSelected}" />
            <TextBlock Text="{Binding Path=Value}"></TextBlock>
        </StackPanel>
    </DataTemplate>
    <!-- ListView Grid -->
    <Style TargetType="{x:Type ListView}">
        <Setter Property="ListView.View">
            <Setter.Value>
                <GridView>
                    <GridView.Columns>
                        <GridViewColumn Header="Value" DisplayMemberBinding="{Binding Path=Value}" />
                        <GridViewColumn Header="Selected" DisplayMemberBinding="{Binding Path=IsSelected}" />
                    </GridView.Columns>
                </GridView>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>